package com.tianzj.boot.util;

import org.apache.shiro.SecurityUtils;

import com.tianzj.boot.mvc.entity.system.SysUser;

/**
 * Created by wangl on 2017/11/25.
 * todo:
 */
public class SessionUser {

    public static Long id() {
        return SysUser().getId();
    }

    public static String loginName() {
        return SysUser().getUserName();
    }

    public static SysUser SysUser() {
        SysUser user = (SysUser) SecurityUtils.getSubject().getPrincipal();
        return user;
    }
}
